package org.jeecg.modules.demo.crm.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.crm.entity.CSubProjectStatusLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: 子项状态变更表
 * @Author: jeecg-boot
 * @Date:   2025-05-27
 * @Version: V1.0
 */
public interface CSubProjectStatusLogMapper extends BaseMapper<CSubProjectStatusLog> {

    @Select("select * from c_sub_project_status_log where  sub_project_id=#{subProjectId} order by change_time desc")
    List<CSubProjectStatusLog> findSubProjectLog(@Param("subProjectId") String subProjectId);

    @Delete("delete from c_sub_project_status_log where  sub_project_id=#{subProjectId} and  new_status = #{newStatus} ")
    void delBySubProjectIdNewStatus(@Param("subProjectId") String subProjectId,@Param("newStatus") String newStatus);
}
